﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

namespace DAO_DTO_WS.DAO
{
    public class Abstract
    {
        public static SqlConnection KetNoi()
        {
            string path = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/DB_BANHANG.mdf");
            //Anh Em xai cai tren nha may nha dom minh xai cai duoi
            String ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=" + path + ";Integrated Security=True;User Instance=True";
            //String ConnectionString ="Data Source=TK\\SQLEXPRESS;AttachDbFilename=D:WEB\\New Folder\\Project\\DAO_DTO_WS\\LayoutTemplate\\App_Data\\DB_BANHANG.mdf;Integrated Security=True";
            SqlConnection connection = new SqlConnection(ConnectionString);
            connection.Open();
            return connection;
        }
    }
}
